projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd892f0
)
Further IDNA tweaks
author
Lars Ingebrigtsen
<larsi@gnus.org>
Mon, 28 Dec 2015 01:57:40 +0000
(
02:57
+0100)
committer
Lars Ingebrigtsen
<larsi@gnus.org>
Mon, 28 Dec 2015 01:57:40 +0000
(
02:57
+0100)
(idna-encode-string): Make idna-encode-string safe for
non-ASCII use.
lisp/net/idna.el
patch
|
blob
|
history
diff --git
a/lisp/net/idna.el
b/lisp/net/idna.el
index f34fb9c490a2f94e2252a39b15069299e240460a..dfaf711c71eb288dccfbfacb52a3164bdaed1668 100644
(file)
--- a/
lisp/net/idna.el
+++ b/
lisp/net/idna.el
@@
-33,7
+33,9
@@
(let ((ascii (seq-filter (lambda (char)
(< char 128))
string)))
- (concat "xn--" ascii "-" (idna-encode-complex (length ascii) string))))
+ (if (= (length ascii) (length string))
+ string
+ (concat "xn--" ascii "-" (idna-encode-complex (length ascii) string)))))
(defconst idna-initial-n 128)
(defconst idna-initial-bias 72)